﻿
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<style type="text/css">
    .zdyGirdPanel {
        width: 100%;
        margin: 0px;
        padding: 0px;
        float: left;
    }
</style>
<script>
    var F_Id = $.request("F_Id");
    $(function () {        
        gridList();
    });

    function gridList() {
        var $gridList = $("#gridList");
        var queryJson = {};
        $gridList.dataGrid({
            url: "/ClientManager/DemandInfos/GetDemandAllotList",
            postData: {},
            height: 630,
            colModel: [
                {
                    label: '操作', name: '', align: 'left', width: 60, formatter: function (cellvalue, options, rowObject) {
                        return "<input type=\"radio\" name=\"F_Radio\" value=\"" + rowObject["F_Id"] + "\" />";
                    }
                },
                { label: '销售人员', name: 'F_RealName' },
                { label: '上一次分配时间', name: 'F_LastTime' },
                { label: '月分配需求数', name: 'F_ShareNum' },
                { label: '自拓需求数(跟进中)', name: 'F_MineNeedNum' },
                { label: '', name: 'F_Id', hidden: true },
            ],
            pager: "#gridPager",
            viewrecords: true,
            multiselect: false,
            sortname: 'F_Id',
            rowNum: 30,
            rowList: [30, 60, 90],
            ondblClickRow: function (rowid, iRow, iCol, e) {
            },
            loadComplete: function (data) {

            }
        });
    }

    function submitForm() {
        debugger
        var F_UserId = $("input[name = 'F_Radio']:checked").val();
        if (F_UserId == undefined) {
            $.modalAlert("请选中行数据！", "warning");
            return false;
        } else {
            $.submitForm({
                url: "/ClientManager/DemandInfos/SubmitAllotForm",
                param: {
                    F_Id: F_Id, F_UserId: F_UserId
                },
                success: function () {
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            });
        }
    }
</script>
<div class="zdyGirdPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>

